<template>
    <el-table :data="logData" border style="width: 100%" align="center">
      <el-table-column prop="username" label="登入账户" width="200"  align="center"/>
      <el-table-column prop="lastLogin.ip" label="上次登入ip" align="center"></el-table-column>
      <el-table-column prop="lastLogin.loginTime" label="上次登入时间" sortable align="center"></el-table-column>
      <el-table-column prop="nowLogin.ip" label="本次登入ip" width="200" align="center"/>
      <el-table-column prop="nowLogin.loginTime" label="本次登入时间"  align="center"/>
    </el-table>
  </template>

<script setup>
// 引入请求的接口
import * as api from "@/api/students.js"
import {onMounted, ref} from "vue"

// 接收请求结果
let logData = ref([])

// 调用store中请求学员日志数据的方法
onMounted(async ()=>{
    try{
      let res = await api.getloginlog()
      // console.log(res)
      logData.value = res.data.data
    }catch(e){
      console.log(e)
    }
})
// console.log('123456789',studentStore.logData)






</script>
<script>
export default{
    meta:{
      title: 'glsy', 
      name: '管理首页',
      routeName:"welcome",
      icon:'#icon-shouye1'
    }


}
</script>


<style lang="less" scoped>
.el-table{
  :deep(.el-table__cell){
    height: 50px;
  }
}




</style>